﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomizedPage.aspx.cs" Inherits="WMS6.Web.Administration.CustomizedPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>CustomizedPage</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/jquery.js" type="text/javascript"></script>
    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>
    <script src="../Js/util.js" id="js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>
    <script src="../Js/checkbox.js" type="text/javascript"></script>
    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            initEditNewPage();
        }
        function curPageSelectAll(chkbox,gv)
        {
            var state = chkbox.checked;
                      
             var TargetBaseControl = document.getElementById(gv);  
             var TargetChildControl = chkbox; 
             
             var Inputs = TargetBaseControl.getElementsByTagName("input"); 
             for(var i=0;i<Inputs.length;i++)
             {
                if(Inputs[i].type == 'checkbox')
                {
                    if(Inputs[i].disabled == false)
                    {
                        Inputs[i].checked = state;               
                        GridViewAllCheckBoxClick(Inputs[i].parentElement.parentElement.id,state);
                    }
                 }
             }
         }
         
         function changeSeqNo(seqno,obj)
         {
            document.getElementById("hdnSeqNo").value = seqno;
            document.getElementById("hdnNewSeqNo").value = obj.value;
            if(parseInt(seqno) != parseInt(obj.value) && parseInt(obj.value) > parseInt(document.getElementById("hdnTotalHiddenSeqNo").value))
            {
                __doPostBack("txSeqNo_TextChanged","");
            }
            else
            {
                obj.value = seqno;
            }
         }
    </script>
</head>
<body>
    <form id="F15051" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblCustomizedPage" runat="server" CssClass="label_header" Text="界面自定义" ></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Enabled="True" 
                            Text="<%$Resources:ButtonResource,btnGoBack%>" OnClick="btnGoBack_Click" Visible="True" />
                    </td>
                      <td>
                        <asp:Button ID="btnGoBack2" runat="server" CssClass="button" Enabled="True" 
                            Text="后退" OnClick="btnGoBack2_Click" Visible="True" />
                    </td>
                    <td>
                        <asp:Button ID="btnSave" runat="server" CssClass="button" Enabled="True" 
                            Text="更新" AccessKey="u"  OnClick="btnSave_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Enabled="True" 
                            Text="还原默认值" AccessKey="d" OnClick="btnDelete_Click" />
                    </td>
                </tr>
            </table>
        </div>
        
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div>
                    <asp:Label ID="lblMsg" runat="server" CssClass="label_message" 
                        meta:resourcekey="lblMsg"></asp:Label>
                </div>
                
                <div id="div_menu">
                    <div style="float: left; width: 8px;">
                        <div class="tabL" id="divL1">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur" id="divM1">
                        <asp:Label ID="one1" CssClass="hover" runat="server" 
                            meta:resourcekey="one1">界面自定义</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR" id="divR1">
                        </div>
                    </div>
                </div>
                
                <div id="div_content">
                    <div id="con_one_1" style="display:block;">
                    <table style=" margin-left:10px; margin-top:10px; margin-bottom:10px; width:720px;">
                        <tr>
                            <td><asp:Label ID="lblUserID" runat="server" CssClass="label" Text="用户代码" ></asp:Label></td>
                            <td><asp:Label ID="lblPageSize" runat="server" CssClass="label" Text="页大小" ></asp:Label></td>
                            <td><asp:Label ID="lblGridviewID" runat="server" CssClass="label" Text="列表代码" ></asp:Label></td>
                            <td><asp:Label ID="lblPage" runat="server" CssClass="label" Text="页面" ></asp:Label></td>
                        </tr>
                        <tr>
                            <td><asp:TextBox ID="txtUserID" runat="server" CssClass="textbox"></asp:TextBox></td>
                            <td><asp:TextBox ID="txtPageSize" runat="server" CssClass="textbox" Text="0"></asp:TextBox></td>
                            <td><asp:TextBox ID="txtGridviewID" runat="server" CssClass="textbox"></asp:TextBox></td>
                            <td><asp:TextBox ID="txtPage" runat="server" CssClass="textbox"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td colspan="4" style="height:10px"></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <asp:GridView ID="gvCustGridview" runat="server" AutoGenerateColumns="False" 
                                    Width="450px" CssClass="gridview"  AllowSorting="True"   onsorting="gvCustGridview_Sorting"
                                    DataKeyNames="FunctionID,GridviewID,ColumnIndex,Udf1,Udf2" PageSize="150" 
                                    onrowdatabound="gvCustGridview_RowDataBound" >
                                    <FooterStyle CssClass="GridViewFooterStyle" />
                                    <RowStyle CssClass="GridViewRowStyle" />
                                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="序号" FooterText="序号" >
                                             <ItemTemplate>
                                                 <asp:TextBox ID="txSeqNo" CssClass="textbox" runat="server" Width="49px" OnTextChanged="txSeqNo_TextChanged"></asp:TextBox>
                                             </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                             <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                         </asp:TemplateField>
                                        <asp:TemplateField>
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" 
                                                    onclick="curPageSelectAll(this,'gvCustGridview');" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chbSelect" runat="server" Checked='<%# Convert.ToBoolean(Eval("Udf1").ToString()) %>'/>
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:CheckBox ID="CheckBox2" runat="server" 
                                                    onclick="curPageSelectAll(this,'gvCustGridview');" />
                                            </FooterTemplate>
                                            <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                            <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                        </asp:TemplateField>
                                         <asp:TemplateField ShowHeader="False">
                                             <ItemTemplate>
                                                 <asp:LinkButton ID="lnkbtnUp" runat="server" OnClick="lnkbtnUp_Click" ><img src="../Images/ico_up.gif" class="img" /></asp:LinkButton>
                                                 &nbsp;
                                                 <asp:LinkButton ID="lnkbtnDown" runat="server" OnClick="lnkbtnDown_Click" ><img src="../Images/ico_down.gif" class="img" /></asp:LinkButton>
                                             </ItemTemplate>
                                             <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                        </asp:TemplateField>
                                         <asp:TemplateField HeaderText="列标题" FooterText="列标题" >
                                             <ItemTemplate>
                                                 <asp:TextBox ID="txtHeaderText" Text='<%# Eval("HeaderText").ToString() %>' CssClass="textbox" runat="server" Width="200px" ></asp:TextBox>
                                             </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_200" />
                                             <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_200" />
                                         </asp:TemplateField>
                                         <asp:TemplateField HeaderText="列宽度" FooterText="列宽度" >
                                             <ItemTemplate>
                                                 <asp:TextBox ID="txtWidth" Text='<%# Eval("Width").ToString() %>' CssClass="textbox" runat="server" Width="49px" ></asp:TextBox>
                                             </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                             <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                         </asp:TemplateField>
                                         <asp:BoundField DataField="ColumnIndex" HeaderText="列索引" FooterText="列索引" Visible="false" 
                                            SortExpression="ColumnIndex">
                                            <ItemStyle CssClass="GridViewRowWidth_50" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="GridviewID" HeaderText="列表代码" FooterText="列表代码" Visible="false" 
                                            SortExpression="GridviewID">
                                            <ItemStyle CssClass="GridViewRowWidth_150" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="FunctionDescr" HeaderText="页面" FooterText="页面"  Visible="false"
                                            SortExpression="FunctionDescr">
                                            <ItemStyle CssClass="GridViewRowWidth_150" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Udf2">
                                            <ItemStyle CssClass="GridViewRowWidth_50" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Udf3">
                                            <ItemStyle CssClass="GridViewRowWidth_50" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Udf4">
                                            <ItemStyle CssClass="GridViewRowWidth_50" />
                                        </asp:BoundField>
                                    </Columns>
                                </asp:GridView>    
                            </td>
                        </tr>
                    </table>
                        
                    </div>
                </div>
                
             </ContentTemplate>
         </asp:UpdatePanel>
    </div>
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdnSeqNo" runat="server" />
    <input type="hidden" id="hdnNewSeqNo" runat="server" />
    <input type="hidden" id="hdnTotalHiddenSeqNo" runat="server" />
    </form>
</body>
</html>
